#!/usr/bin/env python3

import os
from multiprocessing import Process
import multiprocessing


class TestMP():
    #  _instance = None

    #  def __new__(cls):
        #  if not cls._instance:
            #  cls._instane = object.__new__(cls)
        #  return cls._instance

    def __init__(self):
        print("this is %s run" % os.getpid())


def run_test():
    t1 = TestMP()
    print(id(t1))
    t2 = TestMP()
    print(id(t2))



def main():
    #  if os.fork():
        #  t1 = TestMP()
        #  t2 = TestMP()
    #  print(id(t1))
    #  print(id(t2))

    #  p = Process(target=run_test)
    #  p.start()

    m_p = multiprocessing.Pool(2)
    for i in range(2):
        m_p.apply_async(run_test)

    m_p.close()
    m_p.join()




if __name__ == "__main__":
    run_test()
